#ifndef VSEND_H
#define VSEND_H

#include <QWidget>
#include "Network/cudp.h"
#include "qtimer.h"
namespace Ui {
class VSend;
}

class VSend : public QWidget
{
    Q_OBJECT

public:
    explicit VSend(QWidget *parent = nullptr);
    ~VSend();

    virtual void setConnectionProxy(CUdp *pConnect);
    virtual void stateChanged(CUdp::EnmState enmState){
        Q_UNUSED(enmState)
    }
    virtual void connectStateChanged(QString strIp,quint16 nPort,bool bState){
        Q_UNUSED(strIp)
        Q_UNUSED(nPort)
        Q_UNUSED(bState)
    }
    virtual void dataArrive(QString strIp,quint16 nPort,QByteArray byteArr){
        Q_UNUSED(strIp)
        Q_UNUSED(nPort)
        Q_UNUSED(byteArr)
    }
    virtual void send(QByteArray byteArr){
        Q_UNUSED(byteArr)
    }
    void refreshIPList();
    void processSendText(QString &strText, bool &bHex, bool &bIsaddEnter);
    void on_spinBox_auto_span_valueChanged(int arg1);
private:
    Ui::VSend *ui;
    QTimer *m_pTimerAutoSend = nullptr;
protected:
    CUdp *m_pConnect = nullptr;

private slots:
    void on_pushButton_send_clicked();
    void on_checkBox_auto_send_clicked(bool checked);
    void on_pushButton_clear_clicked();
};

#endif // VSEND_H
